from sqlalchemy import Column, Integer, String, ForeignKey
from sqlalchemy.orm import relationship

from ..db.base import Base, TimestampMixin

class Counselor(Base, TimestampMixin):
    """辅导员数据库模型"""
    __tablename__ = "counselors"

    id = Column(Integer, primary_key=True, index=True)
    user_id = Column(Integer, ForeignKey("users.id"), nullable=False, unique=True)
    department = Column(String, nullable=False)
    office_location = Column(String, nullable=True)

    # 关系
    user = relationship("User", back_populates="counselor")